﻿<UserControl x:Class="Citrix.XaAdminMobile.ViewCommon.AddServerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"
             FocusVisualStyle="{x:Null}"
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:vm="clr-namespace:Citrix.XaAdminMobile.ViewModel"
             xmlns:prop="clr-namespace:Citrix.XaAdminMobile.Properties"
             xmlns:cmp="clr-namespace:Citrix.Cmp;assembly=Citrix.Cmp.Wpf"
             >
  <Grid Background="{DynamicResource BubbleBackgroundBrush}">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <!-- Top toolbar -->
    <Border Style="{DynamicResource ToolbarBorderStyle}">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="80"/>
          <ColumnDefinition Width="*"/>
          <ColumnDefinition Width="80"/>
        </Grid.ColumnDefinitions>

        <Button Grid.Column="0" Style="{DynamicResource PlainButtonStyle}"
                Content="{x:Static prop:Resources.CancelButtonLabel}" Command="{Binding CancelCommand}"/>

        <Button Grid.Column="2" Style="{DynamicResource PlainButtonStyle}"
                Content="{x:Static prop:Resources.SaveButtonLabel}" Command="{Binding SaveCommand}"/>
      </Grid>
    </Border>

    <!-- Server name entry -->
    <cmp:ClippingBorder Grid.Row="1" BorderBrush="Gray"
                      Background="White"
                      Margin="10" CornerRadius="10"
                      BorderThickness="1" SnapsToDevicePixels="True">
      <Grid>
        <Grid.ColumnDefinitions>
          <ColumnDefinition Width="Auto"/>
          <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <!-- Prompt -->
        <TextBlock Grid.Column="0" FontSize="20" Text="{x:Static prop:Resources.EnterServerPrompt}"
                   Margin="8,8,5,8"/>

        <!-- Text entry -->
        <TextBox Grid.Column="1" Style="{DynamicResource NoBorderTextBoxStyle}"
                 Text="{Binding ServerName, UpdateSourceTrigger=PropertyChanged}" Margin="0,0,5,0"
                 VerticalAlignment="Stretch" VerticalContentAlignment="Center"
                 FontSize="20"
                 IsEnabled="{Binding CanEditServer}"
                 KeyUp="TextBox_KeyUp"
                 cmp:ClientKeyboardController.AutoShowKeyboard="True"
                 cmp:FocusHelpers.GrabFocusWhenVisible="True"/>
      </Grid>
    </cmp:ClippingBorder>

    <!-- Status message -->
    <TextBlock Grid.Row="2" Text="{Binding StatusMessage}" TextAlignment="Center" FontSize="18"
               TextWrapping="Wrap" />

    <!-- Detailed error message -->
    <TextBlock Grid.Row="3" Text="{Binding ErrorMessage}" TextAlignment="Left" FontSize="18"
               Margin="5,10,5,5" TextWrapping="Wrap" />
  </Grid>
</UserControl>
